package com.atguigu.blog.user.feign;

import com.atguigu.blog.user.entity.Article;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class ArticleFallBackFactoy implements FallbackFactory<ArticleFeignClient> {
    @Override
    public ArticleFeignClient create(Throwable cause) {
        return userId -> {
            List<Article> articleList = new ArrayList<>();
            System.out.println(cause.getMessage());
            return articleList;
        };
    }
}
